<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$(".info").colorbox({width: "40%", height: "70%", iframe: true});
});
</script>
<fieldset><legend>搜索条件</legend>
<form method="get">
<?include (Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>所属平台</th>
	<td>
		<select name="platform">
			<option value="">请选择..</option>
			<option value="amazon" <?=isset($_GET['platform']) && $_GET['platform'] == 'amazon' ? 'selected=selected' : ''?>>amazon</option>
			<option value="amazon2"<?=isset($_GET['platform']) && $_GET['platform'] == 'amazon2' ? 'selected=selected' : ''?>>amazon2</option>
		</select>
	</td>
</tr>
<tr>
	<td colspan="2"><input type="submit" class="button" value="查询" /></td>
</tr>
</table>
</form>
</fieldset>
<table width="100%" class="list_table">
<tr>
	<th>店铺</th>
	<th>平台</th>
	<th>Merchant_Id</th>
	<th>Marketplace_Id</th>
	<th>Access_Key</th>
	<th>Secret_Key</th>
	<th>Endpoint</th>
	<th>Proxy_Host</th>
	<th>Proxy_Port</th>
	<th>Application</th>
	<th>Version</th>
	<th>操作</th>
</tr>
<?foreach ($shop as $s):?>
<tr>
	<td><?=$s['name']?></td>
	<td><?=$s['platform']?></td>
	<td><?=$s['merchant_id']?></td>
	<td><?=$s['marketplace_id']?></td>
	<td><?=$s['access_key'] ? substr($s['access_key'], 0, 10) . '..' : ''?></td>
	<td><?=$s['secret_key'] ? substr($s['secret_key'], 0, 10) . '..' : ''?></td>
	<td><?=$s['mws_endpoint']?></td>
	<td><?=$s['proxy_host']?></td>
	<td><?=$s['proxy_port']?></td>
	<td><?=$s['application_name']?></td>
	<td><?=$s['version']?></td>
	<td><a href="<?=url('Setting::Basic/AmazonTokenEdit', array('shop_id' => $s['shop_id']))?>" class="info">修改</a></td>
</tr>
<?endforeach;?>
</table>
<?php $this->_endblock(); ?>